#ifndef __SQL_COMMON_H__
#define __SQL_COMMON_H__

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "sqlite3.h"
#include "CxlUtil.h"
#include "userLog.h"
#include "configParser.h"
#include "pal/vzResultParse.h"
#include "hal/imx6/src/hal_gps_uv.h"
#include "pal/vzCamCommon.h"

void openPicDb();
void createPicDB();
void insertPicDb(uint8_t picName[PIC_FILENAME_MAX_LEN], uint8_t license[TH_LP_LEN], uint8_t camId,
                 uint8_t fileNo, uint8_t picTimeBcd[BCD_TIME_LENGTH], //
                 gps_t gps,                                           //
                 uint8_t picType);                                    //
void deletePicRows();
void updatePicRowAfterUpload(uint8_t *picName);
void updatePicRowAfterDelete(uint8_t *picName);
void updateRetryCountAfterSendToQueue(uint8_t picName[PIC_FILENAME_MAX_LEN], uint8_t count);
SelectCamResult selectPicDb(uint8_t picType, uint8_t retryCount);
void closePicDb(uv_work_t *handle, int32_t status);

#endif
